package 练习代码.基础代码;

public class 三目运算 {//三目运算求abc大小,
    public static void main(String[] args) {
        //三目运算的格式 条件(boolean)?返回值1:返回值2
        int a=3,b=5,c=7;
        int mid =a>b?a:b;
        int max=mid>c?mid:c;
        System.out.println(max);


        int max1 =a>b?(a>c?a:c):(b>c?b:c);
        System.out.println(max1);


        char m = a==b?'攻':'受';
        System.out.println(m);

        Aoo aoo=new Aoo();
        Aoo boo =new Aoo();
        System.out.println(aoo.getA());
        Aoo n =a==b?aoo:boo;
        System.out.println(n);//只能调出对象地址,无法打点调出数据






    }
}


class Aoo {
    private int a= 3;

    public int getA() {
        return a;
    }
}